package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TicketReceiptRealMapper;
import com.ruoyi.system.domain.TicketReceiptReal;
import com.ruoyi.system.service.ITicketReceiptRealService;

/**
 * 票据本副联关系Service业务层处理
 *
 * @author ruoyi
 * @date 2024-07-19
 */
@Service
public class TicketReceiptRealServiceImpl implements ITicketReceiptRealService
{
    @Autowired
    private TicketReceiptRealMapper ticketReceiptRealMapper;

    /**
     * 查询票据本副联关系
     *
     * @param receiptRealNo 票据本副联关系主键
     * @return 票据本副联关系
     */
    @Override
    public TicketReceiptReal selectTicketReceiptRealByReceiptRealNo(String receiptRealNo)
    {
        return ticketReceiptRealMapper.selectTicketReceiptRealByReceiptRealNo(receiptRealNo);
    }

    /**
     * 查询票据本副联关系列表
     *
     * @param ticketReceiptReal 票据本副联关系
     * @return 票据本副联关系
     */
    @Override
    public List<TicketReceiptReal> selectTicketReceiptRealList(TicketReceiptReal ticketReceiptReal)
    {
        return ticketReceiptRealMapper.selectTicketReceiptRealList(ticketReceiptReal);
    }

    /**
     * 新增票据本副联关系
     *
     * @param ticketReceiptReal 票据本副联关系
     * @return 结果
     */
    @Override
    public int insertTicketReceiptReal(TicketReceiptReal ticketReceiptReal)
    {
        ticketReceiptReal.setCreateTime(DateUtils.getNowDate());
        return ticketReceiptRealMapper.insertTicketReceiptReal(ticketReceiptReal);
    }

    /**
     * 修改票据本副联关系
     *
     * @param ticketReceiptReal 票据本副联关系
     * @return 结果
     */
    @Override
    public int updateTicketReceiptReal(TicketReceiptReal ticketReceiptReal)
    {
        ticketReceiptReal.setUpdateTime(DateUtils.getNowDate());
        return ticketReceiptRealMapper.updateTicketReceiptReal(ticketReceiptReal);
    }

    /**
     * 批量删除票据本副联关系
     *
     * @param receiptRealNos 需要删除的票据本副联关系主键
     * @return 结果
     */
    @Override
    public int deleteTicketReceiptRealByReceiptRealNos(String[] receiptRealNos)
    {
        return ticketReceiptRealMapper.deleteTicketReceiptRealByReceiptRealNos(receiptRealNos);
    }

    /**
     * 删除票据本副联关系信息
     *
     * @param receiptRealNo 票据本副联关系主键
     * @return 结果
     */
    @Override
    public int deleteTicketReceiptRealByReceiptRealNo(String receiptRealNo)
    {
        return ticketReceiptRealMapper.deleteTicketReceiptRealByReceiptRealNo(receiptRealNo);
    }
}
